<template>
  <bui-page-layout ref="pageLayout" :is-z-paging="true">
    <b-bind-mobile @success="onSuccess"></b-bind-mobile>
  </bui-page-layout>
</template>
<script setup>
import { ref } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { globalStore } from "@/store";
const gStore = globalStore();
const typeHome = ref(null);
onLoad((options) => {
  typeHome.value = options.type;
});
const onSuccess = (_res) => {
  gStore.token = _res.data;
  if (typeHome.value === "index") {
    uni.navigateTo({
      url: "/pages/user/member_benefit",
    });
  } else {
    uni.$u.toast("保存成功");
    uni.navigateBack({
      delta: 2,
    });
  }
};
</script>
<style lang="scss">
page {
  background-color: #f6f6f8;
}
</style>
